package com.smartticket.jeju.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.smartticket.jeju.model.Sight;
import com.smartticket.jeju.service.SightService;

@Controller
@RequestMapping("/sightInfo")
public class SightInfo 
{
	@Autowired
	private SightService sightService;
	
	@RequestMapping
	public ModelAndView action(@RequestParam int id, @RequestParam int ticket_id)
	{
		ModelAndView modelAndView = new ModelAndView();
		
		Sight sight = sightService.get(id);
		
		modelAndView.addObject("sight", sight);
		modelAndView.addObject("ticket_id", ticket_id);
		
		return modelAndView;
	}
}
